#ifndef N2MEMORYDRAWER_H_2009_10_16
#define N2MEMORYDRAWER_H_2009_10_16

#include "N2Drawer.h"

class N2MemoryDrawer : public N1Object, public N2Drawer {
public:
    N2MemoryDrawer();
    virtual ~N2MemoryDrawer();

    N1NAME_DECL

    bool createInMemory(uint16 bitsPerPixel, uint32 width, uint32 height);

    void setPaintRegion(N2Region* rgn) { };

    virtual N2Size getSize() const ;
    virtual uint32 getBitsPerPixel() const ;

    virtual N2Palette* getPalette() const { return m_palette; };

    virtual void             setWorldTransform(const N2WorldTransform &wt);
    virtual N2WorldTransform getWorldTransform() const ;

    virtual void     setColor(const N2Color &color);
    virtual N2Color  getColor() const ;

    virtual void     setBrush(N2Brush *brush);
    virtual N2Brush* getBrush() const ;

    virtual N2Color  getPoint(const N2Point &point) const ;

    virtual uint32 getPixel(uint32 x, uint32 y) const ;
    virtual void   setPixel(uint32 x, uint32 y);
    virtual void   drawVertLine(uint32 x, uint32 y1, uint32 y2);
    virtual void   drawHorzLine(uint32 y, uint32 x1, uint32 x2);
    virtual void   fillRect(const N2Rect &rect);

    virtual void drawPoint(const N2Point &point);
    virtual void drawLine(const N2Point &from, const N2Point &to);
    virtual void drawRect(const N2Rect &rect);
    virtual void drawShape(const N2Point *points, uint32 count);

protected:
    char *m_pData;
    uint32 m_nByteInRow;
    uint32 m_nSize;
    uint32 m_nWidth, m_nHeight;
    uint32 m_nBPP;
    N2Palette *m_palette;
    N2Brush *m_brush;
    N2WorldTransform m_wt;
};

#endif //N2MEMORYDRAWER_H_2009_10_16
